<template>
	<view class="card flex-row justify-between" @click="onClick">
		<u-avatar size="100" mode="square" :src="avatar"></u-avatar>
		<view class="info flex-col justify-around">
			<view class="flex-row justify-between">
				<text class="text-cut" style="width: 400rpx;">
					<text class="margin-right text-black text-lg text-bold">{{name}}</text>
					<text class="margin-right">{{job}}</text>
				</text>
				<text class="text-xs margin-right">{{shotDate}}</text>
			</view>
			<view class="company text-cut">{{company}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			avatar: {
				type: String
			},
			name: {
				type: String
			},
			job: {
				type: String
			},
			company: {
				type: String
			},
			date: {
				type: String
			}
		},
		data() {
			return {

			};
		},
		computed: {
			shotDate() {
				if (!this.date) return ''
				return this.date.split(' ').shift()
			}
		},
		methods: {
			onClick() {
				this.$emit('click')
			}
		}
	}
</script>

<style lang="scss">
	.card {
		width: 100%;
		height: 120rpx;
		background: #FFFFFF;
		margin: 2rpx 0;
		padding: 8rpx;

		.info {
			width: calc(100% - 120rpx);
			font-size: 28rpx;
			color: #808389;
			letter-spacing: 2rpx;
		}
	}
</style>
